#include <iostream>
#include <vector>
#include <queue>
#include <functional>
#include <map>

using std::cout;
using std::endl;
using std::vector;
using std::priority_queue;
using std::pair;
using std::map;

class Solution {
public:
    int majorityElement(vector<int>& nums) {
        map<int, int> mp;
        for(auto i: nums){
            mp[i]++;
        }
        
        int retV = 0, retK;
        for(auto [k, v]: mp){
           if(v > retV){
            retV = v;
            retK = k;
           } 
        }
        return retK;
    }
};

int main(int argc, char const *argv[])
{
    /* code */
    Solution sol;
    vector<int> nums{1, 1, 1, 2, 3, 2, 3, 3, 1, 3, 3};
    cout << sol.majorityElement(nums) << endl;
    return 0;
}
